package com.hvisions.server.controller;


import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hvisions.common.MyUaNode;
import com.hvisions.common.Tree;
import com.hvisions.common.enums.EquipmentTypeEnum;
import com.hvisions.config.OpcUaConfig;
import com.hvisions.server.model.TbEquipment;
import com.hvisions.server.service.ITbEquipmentService;
import org.eclipse.milo.opcua.sdk.client.model.nodes.objects.FolderTypeNode;
import org.eclipse.milo.opcua.sdk.client.nodes.UaNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author kzyang
 * @since 2023-02-06
 */
@RestController
@RequestMapping("/equipmentInfo")
public class TbOpcPointController {

    @Autowired
    ITbEquipmentService equipmentService;

    @PostMapping(value = "/syncEquipment")
    public Boolean syncEquipmentInfo(@RequestBody MyUaNode uaNode) throws Exception {
        return equipmentService.asyncEquipment(uaNode);
    }
}
